using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Domain.Entities.Auditing;

namespace Test.DAL.Abstracts
{
    /// <summary>
    /// 实体类：销售订单
    /// </summary>
    [SugarTable("Erp_Sale_Order")]
    public class ErpSaleOrder : FullAuditedAggregateRootWithCreationName<Guid>, IMultiTenant
    {
        public ErpSaleOrder()
        {
        }
        ///<summary>
        ///<para>审批完成时间</para>
        ///</summary>
        [SugarColumn(ColumnName = "ApprovalCompleteTime", IsNullable = true, ColumnDescription = "审批完成时间")]
        public virtual DateTime? ApprovalCompleteTime { get; set; }

        ///<summary>
        ///<para>审批状态：【新建、审批中、审批通过、审批不通过、撤回】</para>
        ///</summary>
        [SugarColumn(ColumnName = "ApprovalStatus", IsNullable = false, ColumnDescription = "审批状态：【新建、审批中、审批通过、审批不通过、撤回】")]
        public virtual int ApprovalStatus { get; set; }

        ///<summary>
        ///<para>客户</para>
        ///</summary>
        [SugarColumn(ColumnName = "CustomerId", IsNullable = false, Length = 36, ColumnDescription = "客户")]
        public virtual Guid CustomerId { get; set; }

        ///<summary>
        ///<para>交货日期</para>
        ///</summary>
        [SugarColumn(ColumnName = "DeliveryDate", IsNullable = true, ColumnDescription = "交货日期")]
        public virtual DateTime? DeliveryDate { get; set; }

        ///<summary>
        ///<para>含税总金额</para>
        ///</summary>
        [SugarColumn(ColumnName = "IncludingTaxTotalAmount", IsNullable = false, ColumnDescription = "含税总金额", Length = 18, DecimalDigits = 2)]
        public virtual decimal IncludingTaxTotalAmount { get; set; }

        ///<summary>
        ///<para>跟单员id</para>
        ///</summary>
        [SugarColumn(ColumnName = "MerchandiserUserId", IsNullable = false, Length = 36, ColumnDescription = "跟单员id")]
        public virtual Guid MerchandiserUserId { get; set; }

        ///<summary>
        ///<para>下一审批人id</para>
        ///</summary>
        [SugarColumn(ColumnName = "NextApprovalUserId", IsNullable = true, Length = 36, ColumnDescription = "下一审批人id")]
        public virtual Guid? NextApprovalUserId { get; set; }

        ///<summary>
        ///<para>下一审批人</para>
        ///</summary>
        [SugarColumn(ColumnName = "NextApprovalUserName", IsNullable = true, Length = 64, ColumnDescription = "下一审批人")]
        public virtual string? NextApprovalUserName { get; set; }

        ///<summary>
        ///<para>销售订单号</para>
        ///</summary>
        [SugarColumn(ColumnName = "OrderNo", IsNullable = false, Length = 64, ColumnDescription = "销售订单号")]
        public virtual string OrderNo { get; set; }

        ///<summary>
        ///<para>所属部门</para>
        ///</summary>
        [SugarColumn(ColumnName = "OrganizationId", IsNullable = true, Length = 36, ColumnDescription = "所属部门")]
        public virtual Guid? OrganizationId { get; set; }

        ///<summary>
        ///<para>税率</para>
        ///</summary>
        [SugarColumn(ColumnName = "Rate", IsNullable = false, ColumnDescription = "税率")]
        public virtual decimal Rate { get; set; }

        ///<summary>
        ///<para>备注</para>
        ///</summary>
        [SugarColumn(ColumnName = "Remark", IsNullable = false, Length = 256, ColumnDescription = "备注")]
        public virtual string Remark { get; set; }

        ///<summary>
        ///<para>销售订单类型Id</para>
        ///</summary>
        [SugarColumn(ColumnName = "SaleOrderTypeId", IsNullable = false, Length = 36, ColumnDescription = "销售订单类型Id")]
        public virtual Guid SaleOrderTypeId { get; set; }

        ///<summary>
        ///<para>状态：【新建、生产中、已完工、结束】</para>
        ///</summary>
        [SugarColumn(ColumnName = "Status", IsNullable = false, ColumnDescription = "状态：【新建、生产中、已完工、结束】")]
        public virtual int Status { get; set; }

        ///<summary>
        ///<para>租户id</para>
        ///</summary>
        [SugarColumn(ColumnName = "TenantId", IsNullable = true, Length = 36, ColumnDescription = "租户id")]
        public virtual Guid? TenantId { get; set; }

        ///<summary>
        ///<para>总金额</para>
        ///</summary>
        [SugarColumn(ColumnName = "TotalAmount", IsNullable = false, ColumnDescription = "总金额", Length = 18, DecimalDigits = 2)]
        public virtual decimal TotalAmount { get; set; }

        ///<summary>
        ///<para>客户采购单号</para>
        ///</summary>
        [SugarColumn(ColumnName = "CustomerPurchaseOrderNo", IsNullable = false, Length = 64, ColumnDescription = "客户采购单号")]
        public virtual string CustomerPurchaseOrderNo { get; set; }
    }
}
